import request from './request'

// export 和 export default的区别
// export导入需要加{}，default不需要，前者适合有多个导出的文件
export const getHomeList = () => request.get('/index/index')
    // 获取搜索标签
export const getSearchPopupData = () => request.get('/search/index')
    // 获取输入文本提示列表
export const getSearchTispData = (params) => request.get('/search/helper', { params })
    // 获取搜索商品列表
export const getGoodsList = (params) => request.get('/goods/list', { params })
    // 清楚历史记录
export const clearHistory = () => request.get('/search/clearhistory')
    // 清楚历史记录
export const goLogin = params => request.post('/auth/loginByWeb', params)

// 清楚历史记录     { params } 等价于  { params : params }
export const getGoodsData = params => request.get('/goods/detail', { params })
    // 相关产品
export const gorRelatedData = params => request.get('/goods/related', { params })
    // 购物车数量
export const GetGoodsCount = () => request.get('/cart/goodscount')
    // 加入购物车
export const addToCard = params => request.post('/cart/add', params)
    // 加入购物车数据
export const getCartListData = () => request.get('/cart/index')
    // 点击切换商品的选中状态
export const changeGoods = params => request.post('/cart/checked', params)
    // 商品步进器
export const stepper = params => request.post('/cart/update', params)
    // 删除商品
export const deleteGoods = params => request.post('/cart/delete', params)